package com.ltxtiyu.video.service.impl;

import com.alibaba.dubbo.config.annotation.Service;

import com.ltxtiyu.video.dao.ltx.AreaDao;
import com.ltxtiyu.video.service.ms.AreaService;
import com.ltxtiyu.video.vo.ms.SelectVO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class AreaServiceImpl implements AreaService {
    @Autowired
    private AreaDao areaDao;
    @Override
    public List<SelectVO> selectAll() {
        List<SelectVO> allProvince=  areaDao.selectAllProvince();
        for (SelectVO select:allProvince ){
           List<SelectVO> allCity = areaDao.selectAllCity(select.getValue());
            if(allCity != null &&allCity.size() >0){
                select.setChildren(allCity);
            }
        }
        return allProvince;
    }
}
